/*
 * @Author: your name
 * @Date: 2021-08-25 11:37:11
 * @LastEditTime: 2021-08-26 14:51:19
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: /backend/src/main/java/com/buaa/demo/Dao/QuestionDao.java
 */
package com.buaa.demo.Dao;

import com.buaa.demo.Entity.Choice;
import com.buaa.demo.Entity.Question;
import com.buaa.demo.Entity.Questionnaire;
import com.buaa.demo.Entity.ShortAnswer;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface QuestionDao {
    int addQuestionnaire(Questionnaire qn);
    Questionnaire getQuestionnaireById(int qn_id);
    List<Questionnaire> getQuestionnaireByUId(int user_id);
    void changeState(int qn_id, String state);
    void submitQuestionnaire(int qn_id);
    void adjustPublishTime(int qn_id, String publish_time);

    void addQuestion(Question q);
    Question getQuestionByQId(int q_id);
    List<Question> getQuestionByQnId(int qn_id);
    void submitQuestion(int q_id);

    void addChoice(Choice c);
    Choice getChoiceByCId(int c_id);
    List<Choice> getChoiceByQId(int q_id);
    void submitChoice(int c_id);

    List<ShortAnswer> getShortAnswerByQId(int q_id);
    void submitShortAnswer(ShortAnswer sa);

    void deleteQuestionnaire(int qn_id);
    void deleteQuestion(int q_id);

}
